%
' Edit the below path to point to your Database. This folder must allow write permissions
' For the IUSER_????? Account name
DBCon = "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=D:\html\users\danielwalkerbiz\database\diary.mdb"
%>
<%
Session.LCID = 2057
'--------------------------------------------------
Function DtPrevSunday(ByVal dt)
Do While WeekDay(dt) > vbSunday
dt = DateAdd("d", -1, dt)
Loop
DtPrevSunday = dt
End Function
'--------------------------------------------------
Sub diary(dtView)
Dim dtToday
dtToday = Date()
Dim dtCurViewMonth ' First day of the currently viewed month
Dim dtCurViewDay ' Current day of the currently viewed month
' Get first day of month
dttmp = dtView
dtday = day(dttmp)
dttmp = dateadd("d", (-dtday+1), dttmp)
dtCurViewMonth = dttmp
Dim iDay, iWeek, sFontColor
%>
<%
dtCurViewDay = DtPrevSunday(dtCurViewMonth)
For iWeek = 0 To 5
Response.Write "
" & vbCrLf
Dim sBGCOLOR
sBGCOLOR = "#ffffff"
For iDay = 0 To 6
sBGCOLOR = "#ffffff"
If Month(dtCurViewDay) = Month(dtCurViewMonth) Then
If dtCurViewDay = dtToday Then sBGCOLOR = "#99ccbb"
else
sBGCOLOR = "#ffffff"
End If
Response.Write "
"
If Month(dtCurViewDay) = Month(dtCurViewMonth) Then
If dtCurViewDay = dtToday Then
sFontColor = "#ff0000"
Else
sFontColor = "#00000"
End If
Response.Write ""
Response.Write "" & Day(dtCurViewDay) & " "
End If
Response.Write "
" & vbCrLf
Next
%>
<%
' --------END OF DRAW CALENDAR SECTION--------
Response.Write "
"
End Sub
%>
<%
set my_conn= Server.CreateObject("ADODB.Connection")
my_Conn.Open DBcon
StrSql= "Select * from diary where dte = #" & Request("view_Date") & "# ORDER BY dte"
rs = my_conn.Execute (StrSql)
' If no records found then no worries just trap error
on Error Resume next
%>
Mortgage Calculator - calcualte your loan payments